package com.example.base;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

/**
 * @author Jiamingzhen
 * @Date 2021/4/16 16:35
 * @ClassName BaseEntity
 * @Introduce
 */
public class BaseEntity<T extends Model<?>> extends Model<T> {
    /**
     * 创建时间
     */
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @JSONField( format = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;


    /**
     * 是否删除
     */
    @TableField(value = "is_del",fill = FieldFill.INSERT)
    private Integer isDel;

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }
    public Date getCreateDate() {
        return createDate;
    }

    public BaseEntity<T> setCreateDate(final Date createDate) {
        this.createDate = createDate;
        return this;
    }
}
